Mathematica  Counts Primes

Information["PrimeQ",LongForm->True]

PrimeQ[7]

Information["Prime",LongForm->True]

Prime[5]

PrimePi[1000]

?PrimePi

The following Mathematica definition of the number of primes less than or equal to x is due to Illan Vardi.

MyPrimePi::"usage"="MyPrimePi[n] returns the number of primes less than or equal to n for large n"
Attributes[MyPrimePi]=Listable;
MyPrimePi[n_]:=MyPrimePi[Floor[n]]/;!(IntegerQ[n])
MyPrimePi[n_Integer]:=0/;n≤1;
MyPrimePi[2]=1;
MyPrimePi[3]=2;
MyPrimePi[4]=2;
MyPrimePi[8]=4;
MyPrimePi[10]=4;
MyPrimePi[n_Integer]:=Floor[n/(Log[n]-1.08366)]; (* Legendre *)

Table[MyPrimePi[x],{x,200,1000}];

Plot[MyPrimePi[x],{x,200,1000},
             AxesOrigin->{0,0},
             AxesLabel->  {"n", "# of primes"},
             PlotStyle->PointSize[0.001]]

(*  LogIntegral[n],(n/(Log[n])) suggested by Gauss *)

Plot[{PrimePi[x], MyPrimePi[x],LogIntegral[x],(x/(Log[x]))},{x,200,1000},
         PlotStyle->{Black,Red, Blue,Green},
         AxesOrigin->{0,0},
         AxesLabel->{"n", "# of primes"}]

Riemann's Approximation for π(n)
and others